// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Elastic.Clients.Elasticsearch.Serverless.Security;

public partial class SecurityNamespacedClient : NamespacedClientProxy
{
	/// <summary>
	/// <para>
	/// Initializes a new instance of the <see cref="SecurityNamespacedClient"/> class for mocking.
	/// </para>
	/// </summary>
	protected SecurityNamespacedClient() : base()
	{
	}

	internal SecurityNamespacedClient(ElasticsearchClient client) : base(client)
	{
	}

	/// <summary>
	/// <para>
	/// Creates or updates a user profile on behalf of another user.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ActivateUserProfileResponse> ActivateUserProfileAsync(ActivateUserProfileRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<ActivateUserProfileRequest, ActivateUserProfileResponse, ActivateUserProfileRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates or updates a user profile on behalf of another user.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ActivateUserProfileResponse> ActivateUserProfileAsync(ActivateUserProfileRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<ActivateUserProfileRequestDescriptor, ActivateUserProfileResponse, ActivateUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates or updates a user profile on behalf of another user.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ActivateUserProfileResponse> ActivateUserProfileAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new ActivateUserProfileRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<ActivateUserProfileRequestDescriptor, ActivateUserProfileResponse, ActivateUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates or updates a user profile on behalf of another user.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-activate-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ActivateUserProfileResponse> ActivateUserProfileAsync(Action<ActivateUserProfileRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new ActivateUserProfileRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<ActivateUserProfileRequestDescriptor, ActivateUserProfileResponse, ActivateUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Authenticate a user.
	/// Authenticates a user and returns information about the authenticated user.
	/// Include the user information in a <a href="https://en.wikipedia.org/wiki/Basic_access_authentication">basic auth header</a>.
	/// A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user.
	/// If the user cannot be authenticated, this API returns a 401 status code.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<AuthenticateResponse> AuthenticateAsync(AuthenticateRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<AuthenticateRequest, AuthenticateResponse, AuthenticateRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Authenticate a user.
	/// Authenticates a user and returns information about the authenticated user.
	/// Include the user information in a <a href="https://en.wikipedia.org/wiki/Basic_access_authentication">basic auth header</a>.
	/// A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user.
	/// If the user cannot be authenticated, this API returns a 401 status code.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<AuthenticateResponse> AuthenticateAsync(AuthenticateRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<AuthenticateRequestDescriptor, AuthenticateResponse, AuthenticateRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Authenticate a user.
	/// Authenticates a user and returns information about the authenticated user.
	/// Include the user information in a <a href="https://en.wikipedia.org/wiki/Basic_access_authentication">basic auth header</a>.
	/// A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user.
	/// If the user cannot be authenticated, this API returns a 401 status code.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<AuthenticateResponse> AuthenticateAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new AuthenticateRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<AuthenticateRequestDescriptor, AuthenticateResponse, AuthenticateRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Authenticate a user.
	/// Authenticates a user and returns information about the authenticated user.
	/// Include the user information in a <a href="https://en.wikipedia.org/wiki/Basic_access_authentication">basic auth header</a>.
	/// A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user.
	/// If the user cannot be authenticated, this API returns a 401 status code.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<AuthenticateResponse> AuthenticateAsync(Action<AuthenticateRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new AuthenticateRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<AuthenticateRequestDescriptor, AuthenticateResponse, AuthenticateRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The bulk delete roles API cannot delete roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<BulkDeleteRoleResponse> BulkDeleteRoleAsync(BulkDeleteRoleRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<BulkDeleteRoleRequest, BulkDeleteRoleResponse, BulkDeleteRoleRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The bulk delete roles API cannot delete roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<BulkDeleteRoleResponse> BulkDeleteRoleAsync(BulkDeleteRoleRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<BulkDeleteRoleRequestDescriptor, BulkDeleteRoleResponse, BulkDeleteRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The bulk delete roles API cannot delete roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<BulkDeleteRoleResponse> BulkDeleteRoleAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new BulkDeleteRoleRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<BulkDeleteRoleRequestDescriptor, BulkDeleteRoleResponse, BulkDeleteRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The bulk delete roles API cannot delete roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<BulkDeleteRoleResponse> BulkDeleteRoleAsync(Action<BulkDeleteRoleRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new BulkDeleteRoleRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<BulkDeleteRoleRequestDescriptor, BulkDeleteRoleResponse, BulkDeleteRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The bulk create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<BulkPutRoleResponse> BulkPutRoleAsync(BulkPutRoleRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<BulkPutRoleRequest, BulkPutRoleResponse, BulkPutRoleRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The bulk create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<BulkPutRoleResponse> BulkPutRoleAsync<TDocument>(BulkPutRoleRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<BulkPutRoleRequestDescriptor<TDocument>, BulkPutRoleResponse, BulkPutRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The bulk create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<BulkPutRoleResponse> BulkPutRoleAsync<TDocument>(CancellationToken cancellationToken = default)
	{
		var descriptor = new BulkPutRoleRequestDescriptor<TDocument>();
		descriptor.BeforeRequest();
		return DoRequestAsync<BulkPutRoleRequestDescriptor<TDocument>, BulkPutRoleResponse, BulkPutRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The bulk create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<BulkPutRoleResponse> BulkPutRoleAsync<TDocument>(Action<BulkPutRoleRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new BulkPutRoleRequestDescriptor<TDocument>();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<BulkPutRoleRequestDescriptor<TDocument>, BulkPutRoleResponse, BulkPutRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The bulk create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<BulkPutRoleResponse> BulkPutRoleAsync(BulkPutRoleRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<BulkPutRoleRequestDescriptor, BulkPutRoleResponse, BulkPutRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The bulk create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<BulkPutRoleResponse> BulkPutRoleAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new BulkPutRoleRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<BulkPutRoleRequestDescriptor, BulkPutRoleResponse, BulkPutRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The bulk create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<BulkPutRoleResponse> BulkPutRoleAsync(Action<BulkPutRoleRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new BulkPutRoleRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<BulkPutRoleRequestDescriptor, BulkPutRoleResponse, BulkPutRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts a subset of all entries from the API key cache.
	/// The cache is also automatically cleared on state changes of the security index.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearApiKeyCacheResponse> ClearApiKeyCacheAsync(ClearApiKeyCacheRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<ClearApiKeyCacheRequest, ClearApiKeyCacheResponse, ClearApiKeyCacheRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts a subset of all entries from the API key cache.
	/// The cache is also automatically cleared on state changes of the security index.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearApiKeyCacheResponse> ClearApiKeyCacheAsync(ClearApiKeyCacheRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearApiKeyCacheRequestDescriptor, ClearApiKeyCacheResponse, ClearApiKeyCacheRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts a subset of all entries from the API key cache.
	/// The cache is also automatically cleared on state changes of the security index.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearApiKeyCacheResponse> ClearApiKeyCacheAsync(Elastic.Clients.Elasticsearch.Serverless.Ids ids, CancellationToken cancellationToken = default)
	{
		var descriptor = new ClearApiKeyCacheRequestDescriptor(ids);
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearApiKeyCacheRequestDescriptor, ClearApiKeyCacheResponse, ClearApiKeyCacheRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts a subset of all entries from the API key cache.
	/// The cache is also automatically cleared on state changes of the security index.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearApiKeyCacheResponse> ClearApiKeyCacheAsync(Elastic.Clients.Elasticsearch.Serverless.Ids ids, Action<ClearApiKeyCacheRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new ClearApiKeyCacheRequestDescriptor(ids);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearApiKeyCacheRequestDescriptor, ClearApiKeyCacheResponse, ClearApiKeyCacheRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts application privileges from the native application privileges cache.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedPrivilegesResponse> ClearCachedPrivilegesAsync(ClearCachedPrivilegesRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<ClearCachedPrivilegesRequest, ClearCachedPrivilegesResponse, ClearCachedPrivilegesRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts application privileges from the native application privileges cache.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedPrivilegesResponse> ClearCachedPrivilegesAsync(ClearCachedPrivilegesRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearCachedPrivilegesRequestDescriptor, ClearCachedPrivilegesResponse, ClearCachedPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts application privileges from the native application privileges cache.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedPrivilegesResponse> ClearCachedPrivilegesAsync(Elastic.Clients.Elasticsearch.Serverless.Name application, CancellationToken cancellationToken = default)
	{
		var descriptor = new ClearCachedPrivilegesRequestDescriptor(application);
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearCachedPrivilegesRequestDescriptor, ClearCachedPrivilegesResponse, ClearCachedPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts application privileges from the native application privileges cache.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedPrivilegesResponse> ClearCachedPrivilegesAsync(Elastic.Clients.Elasticsearch.Serverless.Name application, Action<ClearCachedPrivilegesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new ClearCachedPrivilegesRequestDescriptor(application);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearCachedPrivilegesRequestDescriptor, ClearCachedPrivilegesResponse, ClearCachedPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts users from the user cache. Can completely clear the cache or evict specific users.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedRealmsResponse> ClearCachedRealmsAsync(ClearCachedRealmsRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<ClearCachedRealmsRequest, ClearCachedRealmsResponse, ClearCachedRealmsRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts users from the user cache. Can completely clear the cache or evict specific users.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedRealmsResponse> ClearCachedRealmsAsync(ClearCachedRealmsRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearCachedRealmsRequestDescriptor, ClearCachedRealmsResponse, ClearCachedRealmsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts users from the user cache. Can completely clear the cache or evict specific users.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedRealmsResponse> ClearCachedRealmsAsync(Elastic.Clients.Elasticsearch.Serverless.Names realms, CancellationToken cancellationToken = default)
	{
		var descriptor = new ClearCachedRealmsRequestDescriptor(realms);
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearCachedRealmsRequestDescriptor, ClearCachedRealmsResponse, ClearCachedRealmsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts users from the user cache. Can completely clear the cache or evict specific users.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedRealmsResponse> ClearCachedRealmsAsync(Elastic.Clients.Elasticsearch.Serverless.Names realms, Action<ClearCachedRealmsRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new ClearCachedRealmsRequestDescriptor(realms);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearCachedRealmsRequestDescriptor, ClearCachedRealmsResponse, ClearCachedRealmsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts roles from the native role cache.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedRolesResponse> ClearCachedRolesAsync(ClearCachedRolesRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<ClearCachedRolesRequest, ClearCachedRolesResponse, ClearCachedRolesRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts roles from the native role cache.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedRolesResponse> ClearCachedRolesAsync(ClearCachedRolesRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearCachedRolesRequestDescriptor, ClearCachedRolesResponse, ClearCachedRolesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts roles from the native role cache.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedRolesResponse> ClearCachedRolesAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default)
	{
		var descriptor = new ClearCachedRolesRequestDescriptor(name);
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearCachedRolesRequestDescriptor, ClearCachedRolesResponse, ClearCachedRolesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts roles from the native role cache.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedRolesResponse> ClearCachedRolesAsync(Elastic.Clients.Elasticsearch.Serverless.Names name, Action<ClearCachedRolesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new ClearCachedRolesRequestDescriptor(name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearCachedRolesRequestDescriptor, ClearCachedRolesResponse, ClearCachedRolesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts tokens from the service account token caches.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedServiceTokensResponse> ClearCachedServiceTokensAsync(ClearCachedServiceTokensRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<ClearCachedServiceTokensRequest, ClearCachedServiceTokensResponse, ClearCachedServiceTokensRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts tokens from the service account token caches.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedServiceTokensResponse> ClearCachedServiceTokensAsync(ClearCachedServiceTokensRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearCachedServiceTokensRequestDescriptor, ClearCachedServiceTokensResponse, ClearCachedServiceTokensRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts tokens from the service account token caches.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedServiceTokensResponse> ClearCachedServiceTokensAsync(string ns, string service, Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default)
	{
		var descriptor = new ClearCachedServiceTokensRequestDescriptor(ns, service, name);
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearCachedServiceTokensRequestDescriptor, ClearCachedServiceTokensResponse, ClearCachedServiceTokensRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Evicts tokens from the service account token caches.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<ClearCachedServiceTokensResponse> ClearCachedServiceTokensAsync(string ns, string service, Elastic.Clients.Elasticsearch.Serverless.Names name, Action<ClearCachedServiceTokensRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new ClearCachedServiceTokensRequestDescriptor(ns, service, name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<ClearCachedServiceTokensRequestDescriptor, ClearCachedServiceTokensResponse, ClearCachedServiceTokensRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create an API key.
	/// Creates an API key for access without requiring basic authentication.
	/// A successful request returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateApiKeyResponse> CreateApiKeyAsync(CreateApiKeyRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<CreateApiKeyRequest, CreateApiKeyResponse, CreateApiKeyRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create an API key.
	/// Creates an API key for access without requiring basic authentication.
	/// A successful request returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateApiKeyResponse> CreateApiKeyAsync<TDocument>(CreateApiKeyRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<CreateApiKeyRequestDescriptor<TDocument>, CreateApiKeyResponse, CreateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create an API key.
	/// Creates an API key for access without requiring basic authentication.
	/// A successful request returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateApiKeyResponse> CreateApiKeyAsync<TDocument>(CancellationToken cancellationToken = default)
	{
		var descriptor = new CreateApiKeyRequestDescriptor<TDocument>();
		descriptor.BeforeRequest();
		return DoRequestAsync<CreateApiKeyRequestDescriptor<TDocument>, CreateApiKeyResponse, CreateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create an API key.
	/// Creates an API key for access without requiring basic authentication.
	/// A successful request returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateApiKeyResponse> CreateApiKeyAsync<TDocument>(Action<CreateApiKeyRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new CreateApiKeyRequestDescriptor<TDocument>();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<CreateApiKeyRequestDescriptor<TDocument>, CreateApiKeyResponse, CreateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create an API key.
	/// Creates an API key for access without requiring basic authentication.
	/// A successful request returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateApiKeyResponse> CreateApiKeyAsync(CreateApiKeyRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<CreateApiKeyRequestDescriptor, CreateApiKeyResponse, CreateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create an API key.
	/// Creates an API key for access without requiring basic authentication.
	/// A successful request returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateApiKeyResponse> CreateApiKeyAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new CreateApiKeyRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<CreateApiKeyRequestDescriptor, CreateApiKeyResponse, CreateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Create an API key.
	/// Creates an API key for access without requiring basic authentication.
	/// A successful request returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateApiKeyResponse> CreateApiKeyAsync(Action<CreateApiKeyRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new CreateApiKeyRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<CreateApiKeyRequestDescriptor, CreateApiKeyResponse, CreateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a service accounts token for access without requiring basic authentication.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateServiceTokenResponse> CreateServiceTokenAsync(CreateServiceTokenRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<CreateServiceTokenRequest, CreateServiceTokenResponse, CreateServiceTokenRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a service accounts token for access without requiring basic authentication.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateServiceTokenResponse> CreateServiceTokenAsync(CreateServiceTokenRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<CreateServiceTokenRequestDescriptor, CreateServiceTokenResponse, CreateServiceTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a service accounts token for access without requiring basic authentication.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateServiceTokenResponse> CreateServiceTokenAsync(string ns, string service, Elastic.Clients.Elasticsearch.Serverless.Name? name, CancellationToken cancellationToken = default)
	{
		var descriptor = new CreateServiceTokenRequestDescriptor(ns, service, name);
		descriptor.BeforeRequest();
		return DoRequestAsync<CreateServiceTokenRequestDescriptor, CreateServiceTokenResponse, CreateServiceTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a service accounts token for access without requiring basic authentication.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateServiceTokenResponse> CreateServiceTokenAsync(string ns, string service, Elastic.Clients.Elasticsearch.Serverless.Name? name, Action<CreateServiceTokenRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new CreateServiceTokenRequestDescriptor(ns, service, name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<CreateServiceTokenRequestDescriptor, CreateServiceTokenResponse, CreateServiceTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a service accounts token for access without requiring basic authentication.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateServiceTokenResponse> CreateServiceTokenAsync(string ns, string service, CancellationToken cancellationToken = default)
	{
		var descriptor = new CreateServiceTokenRequestDescriptor(ns, service);
		descriptor.BeforeRequest();
		return DoRequestAsync<CreateServiceTokenRequestDescriptor, CreateServiceTokenResponse, CreateServiceTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a service accounts token for access without requiring basic authentication.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<CreateServiceTokenResponse> CreateServiceTokenAsync(string ns, string service, Action<CreateServiceTokenRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new CreateServiceTokenRequestDescriptor(ns, service);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<CreateServiceTokenRequestDescriptor, CreateServiceTokenResponse, CreateServiceTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Removes application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeletePrivilegesResponse> DeletePrivilegesAsync(DeletePrivilegesRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<DeletePrivilegesRequest, DeletePrivilegesResponse, DeletePrivilegesRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Removes application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeletePrivilegesResponse> DeletePrivilegesAsync(DeletePrivilegesRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<DeletePrivilegesRequestDescriptor, DeletePrivilegesResponse, DeletePrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Removes application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeletePrivilegesResponse> DeletePrivilegesAsync(Elastic.Clients.Elasticsearch.Serverless.Name application, Elastic.Clients.Elasticsearch.Serverless.Names name, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeletePrivilegesRequestDescriptor(application, name);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeletePrivilegesRequestDescriptor, DeletePrivilegesResponse, DeletePrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Removes application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeletePrivilegesResponse> DeletePrivilegesAsync(Elastic.Clients.Elasticsearch.Serverless.Name application, Elastic.Clients.Elasticsearch.Serverless.Names name, Action<DeletePrivilegesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeletePrivilegesRequestDescriptor(application, name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeletePrivilegesRequestDescriptor, DeletePrivilegesResponse, DeletePrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Removes roles in the native realm.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRoleResponse> DeleteRoleAsync(DeleteRoleRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<DeleteRoleRequest, DeleteRoleResponse, DeleteRoleRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Removes roles in the native realm.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRoleResponse> DeleteRoleAsync(DeleteRoleRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteRoleRequestDescriptor, DeleteRoleResponse, DeleteRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Removes roles in the native realm.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRoleResponse> DeleteRoleAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteRoleRequestDescriptor(name);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteRoleRequestDescriptor, DeleteRoleResponse, DeleteRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Removes roles in the native realm.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRoleResponse> DeleteRoleAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action<DeleteRoleRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteRoleRequestDescriptor(name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteRoleRequestDescriptor, DeleteRoleResponse, DeleteRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Removes role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRoleMappingResponse> DeleteRoleMappingAsync(DeleteRoleMappingRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<DeleteRoleMappingRequest, DeleteRoleMappingResponse, DeleteRoleMappingRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Removes role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRoleMappingResponse> DeleteRoleMappingAsync(DeleteRoleMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteRoleMappingRequestDescriptor, DeleteRoleMappingResponse, DeleteRoleMappingRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Removes role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRoleMappingResponse> DeleteRoleMappingAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteRoleMappingRequestDescriptor(name);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteRoleMappingRequestDescriptor, DeleteRoleMappingResponse, DeleteRoleMappingRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Removes role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteRoleMappingResponse> DeleteRoleMappingAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action<DeleteRoleMappingRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteRoleMappingRequestDescriptor(name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteRoleMappingRequestDescriptor, DeleteRoleMappingResponse, DeleteRoleMappingRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Deletes a service account token.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteServiceTokenResponse> DeleteServiceTokenAsync(DeleteServiceTokenRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<DeleteServiceTokenRequest, DeleteServiceTokenResponse, DeleteServiceTokenRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Deletes a service account token.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteServiceTokenResponse> DeleteServiceTokenAsync(DeleteServiceTokenRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteServiceTokenRequestDescriptor, DeleteServiceTokenResponse, DeleteServiceTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Deletes a service account token.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteServiceTokenResponse> DeleteServiceTokenAsync(string ns, string service, Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteServiceTokenRequestDescriptor(ns, service, name);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteServiceTokenRequestDescriptor, DeleteServiceTokenResponse, DeleteServiceTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Deletes a service account token.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DeleteServiceTokenResponse> DeleteServiceTokenAsync(string ns, string service, Elastic.Clients.Elasticsearch.Serverless.Name name, Action<DeleteServiceTokenRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new DeleteServiceTokenRequestDescriptor(ns, service, name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<DeleteServiceTokenRequestDescriptor, DeleteServiceTokenResponse, DeleteServiceTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Disables a user profile so it's not visible in user profile searches.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DisableUserProfileResponse> DisableUserProfileAsync(DisableUserProfileRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<DisableUserProfileRequest, DisableUserProfileResponse, DisableUserProfileRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Disables a user profile so it's not visible in user profile searches.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DisableUserProfileResponse> DisableUserProfileAsync(DisableUserProfileRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<DisableUserProfileRequestDescriptor, DisableUserProfileResponse, DisableUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Disables a user profile so it's not visible in user profile searches.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DisableUserProfileResponse> DisableUserProfileAsync(string uid, CancellationToken cancellationToken = default)
	{
		var descriptor = new DisableUserProfileRequestDescriptor(uid);
		descriptor.BeforeRequest();
		return DoRequestAsync<DisableUserProfileRequestDescriptor, DisableUserProfileResponse, DisableUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Disables a user profile so it's not visible in user profile searches.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-disable-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<DisableUserProfileResponse> DisableUserProfileAsync(string uid, Action<DisableUserProfileRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new DisableUserProfileRequestDescriptor(uid);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<DisableUserProfileRequestDescriptor, DisableUserProfileResponse, DisableUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Enables a user profile so it's visible in user profile searches.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<EnableUserProfileResponse> EnableUserProfileAsync(EnableUserProfileRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<EnableUserProfileRequest, EnableUserProfileResponse, EnableUserProfileRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Enables a user profile so it's visible in user profile searches.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<EnableUserProfileResponse> EnableUserProfileAsync(EnableUserProfileRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<EnableUserProfileRequestDescriptor, EnableUserProfileResponse, EnableUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Enables a user profile so it's visible in user profile searches.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<EnableUserProfileResponse> EnableUserProfileAsync(string uid, CancellationToken cancellationToken = default)
	{
		var descriptor = new EnableUserProfileRequestDescriptor(uid);
		descriptor.BeforeRequest();
		return DoRequestAsync<EnableUserProfileRequestDescriptor, EnableUserProfileResponse, EnableUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Enables a user profile so it's visible in user profile searches.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-enable-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<EnableUserProfileResponse> EnableUserProfileAsync(string uid, Action<EnableUserProfileRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new EnableUserProfileRequestDescriptor(uid);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<EnableUserProfileRequestDescriptor, EnableUserProfileResponse, EnableUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get API key information.
	/// Retrieves information for one or more API keys.
	/// NOTE: If you have only the <c>manage_own_api_key</c> privilege, this API returns only the API keys that you own.
	/// If you have <c>read_security</c>, <c>manage_api_key</c> or greater privileges (including <c>manage_security</c>), this API returns all API keys regardless of ownership.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetApiKeyResponse> GetApiKeyAsync(GetApiKeyRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetApiKeyRequest, GetApiKeyResponse, GetApiKeyRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get API key information.
	/// Retrieves information for one or more API keys.
	/// NOTE: If you have only the <c>manage_own_api_key</c> privilege, this API returns only the API keys that you own.
	/// If you have <c>read_security</c>, <c>manage_api_key</c> or greater privileges (including <c>manage_security</c>), this API returns all API keys regardless of ownership.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetApiKeyResponse> GetApiKeyAsync(GetApiKeyRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetApiKeyRequestDescriptor, GetApiKeyResponse, GetApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get API key information.
	/// Retrieves information for one or more API keys.
	/// NOTE: If you have only the <c>manage_own_api_key</c> privilege, this API returns only the API keys that you own.
	/// If you have <c>read_security</c>, <c>manage_api_key</c> or greater privileges (including <c>manage_security</c>), this API returns all API keys regardless of ownership.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetApiKeyResponse> GetApiKeyAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new GetApiKeyRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<GetApiKeyRequestDescriptor, GetApiKeyResponse, GetApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get API key information.
	/// Retrieves information for one or more API keys.
	/// NOTE: If you have only the <c>manage_own_api_key</c> privilege, this API returns only the API keys that you own.
	/// If you have <c>read_security</c>, <c>manage_api_key</c> or greater privileges (including <c>manage_security</c>), this API returns all API keys regardless of ownership.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetApiKeyResponse> GetApiKeyAsync(Action<GetApiKeyRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetApiKeyRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetApiKeyRequestDescriptor, GetApiKeyResponse, GetApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetBuiltinPrivilegesResponse> GetBuiltinPrivilegesAsync(GetBuiltinPrivilegesRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetBuiltinPrivilegesRequest, GetBuiltinPrivilegesResponse, GetBuiltinPrivilegesRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetBuiltinPrivilegesResponse> GetBuiltinPrivilegesAsync(GetBuiltinPrivilegesRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetBuiltinPrivilegesRequestDescriptor, GetBuiltinPrivilegesResponse, GetBuiltinPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetBuiltinPrivilegesResponse> GetBuiltinPrivilegesAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new GetBuiltinPrivilegesRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<GetBuiltinPrivilegesRequestDescriptor, GetBuiltinPrivilegesResponse, GetBuiltinPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetBuiltinPrivilegesResponse> GetBuiltinPrivilegesAsync(Action<GetBuiltinPrivilegesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetBuiltinPrivilegesRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetBuiltinPrivilegesRequestDescriptor, GetBuiltinPrivilegesResponse, GetBuiltinPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetPrivilegesResponse> GetPrivilegesAsync(GetPrivilegesRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetPrivilegesRequest, GetPrivilegesResponse, GetPrivilegesRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetPrivilegesResponse> GetPrivilegesAsync(GetPrivilegesRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetPrivilegesRequestDescriptor, GetPrivilegesResponse, GetPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetPrivilegesResponse> GetPrivilegesAsync(Elastic.Clients.Elasticsearch.Serverless.Name? application, Elastic.Clients.Elasticsearch.Serverless.Names? name, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetPrivilegesRequestDescriptor(application, name);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetPrivilegesRequestDescriptor, GetPrivilegesResponse, GetPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetPrivilegesResponse> GetPrivilegesAsync(Elastic.Clients.Elasticsearch.Serverless.Name? application, Elastic.Clients.Elasticsearch.Serverless.Names? name, Action<GetPrivilegesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetPrivilegesRequestDescriptor(application, name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetPrivilegesRequestDescriptor, GetPrivilegesResponse, GetPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetPrivilegesResponse> GetPrivilegesAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new GetPrivilegesRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<GetPrivilegesRequestDescriptor, GetPrivilegesResponse, GetPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetPrivilegesResponse> GetPrivilegesAsync(Action<GetPrivilegesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetPrivilegesRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetPrivilegesRequestDescriptor, GetPrivilegesResponse, GetPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The get roles API cannot retrieve roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRoleResponse> GetRoleAsync(GetRoleRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetRoleRequest, GetRoleResponse, GetRoleRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The get roles API cannot retrieve roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRoleResponse> GetRoleAsync(GetRoleRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRoleRequestDescriptor, GetRoleResponse, GetRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The get roles API cannot retrieve roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRoleResponse> GetRoleAsync(Elastic.Clients.Elasticsearch.Serverless.Names? name, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetRoleRequestDescriptor(name);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRoleRequestDescriptor, GetRoleResponse, GetRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The get roles API cannot retrieve roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRoleResponse> GetRoleAsync(Elastic.Clients.Elasticsearch.Serverless.Names? name, Action<GetRoleRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetRoleRequestDescriptor(name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRoleRequestDescriptor, GetRoleResponse, GetRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The get roles API cannot retrieve roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRoleResponse> GetRoleAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new GetRoleRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRoleRequestDescriptor, GetRoleResponse, GetRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The get roles API cannot retrieve roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRoleResponse> GetRoleAsync(Action<GetRoleRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetRoleRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRoleRequestDescriptor, GetRoleResponse, GetRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRoleMappingResponse> GetRoleMappingAsync(GetRoleMappingRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetRoleMappingRequest, GetRoleMappingResponse, GetRoleMappingRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRoleMappingResponse> GetRoleMappingAsync(GetRoleMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRoleMappingRequestDescriptor, GetRoleMappingResponse, GetRoleMappingRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRoleMappingResponse> GetRoleMappingAsync(Elastic.Clients.Elasticsearch.Serverless.Names? name, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetRoleMappingRequestDescriptor(name);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRoleMappingRequestDescriptor, GetRoleMappingResponse, GetRoleMappingRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRoleMappingResponse> GetRoleMappingAsync(Elastic.Clients.Elasticsearch.Serverless.Names? name, Action<GetRoleMappingRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetRoleMappingRequestDescriptor(name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRoleMappingRequestDescriptor, GetRoleMappingResponse, GetRoleMappingRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRoleMappingResponse> GetRoleMappingAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new GetRoleMappingRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRoleMappingRequestDescriptor, GetRoleMappingResponse, GetRoleMappingRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetRoleMappingResponse> GetRoleMappingAsync(Action<GetRoleMappingRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetRoleMappingRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetRoleMappingRequestDescriptor, GetRoleMappingResponse, GetRoleMappingRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// This API returns a list of service accounts that match the provided path parameter(s).
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetServiceAccountsResponse> GetServiceAccountsAsync(GetServiceAccountsRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetServiceAccountsRequest, GetServiceAccountsResponse, GetServiceAccountsRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// This API returns a list of service accounts that match the provided path parameter(s).
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetServiceAccountsResponse> GetServiceAccountsAsync(GetServiceAccountsRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetServiceAccountsRequestDescriptor, GetServiceAccountsResponse, GetServiceAccountsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// This API returns a list of service accounts that match the provided path parameter(s).
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetServiceAccountsResponse> GetServiceAccountsAsync(string? ns, string? service, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetServiceAccountsRequestDescriptor(ns, service);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetServiceAccountsRequestDescriptor, GetServiceAccountsResponse, GetServiceAccountsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// This API returns a list of service accounts that match the provided path parameter(s).
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetServiceAccountsResponse> GetServiceAccountsAsync(string? ns, string? service, Action<GetServiceAccountsRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetServiceAccountsRequestDescriptor(ns, service);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetServiceAccountsRequestDescriptor, GetServiceAccountsResponse, GetServiceAccountsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// This API returns a list of service accounts that match the provided path parameter(s).
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetServiceAccountsResponse> GetServiceAccountsAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new GetServiceAccountsRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<GetServiceAccountsRequestDescriptor, GetServiceAccountsResponse, GetServiceAccountsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// This API returns a list of service accounts that match the provided path parameter(s).
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetServiceAccountsResponse> GetServiceAccountsAsync(Action<GetServiceAccountsRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetServiceAccountsRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetServiceAccountsRequestDescriptor, GetServiceAccountsResponse, GetServiceAccountsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves information of all service credentials for a service account.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetServiceCredentialsResponse> GetServiceCredentialsAsync(GetServiceCredentialsRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetServiceCredentialsRequest, GetServiceCredentialsResponse, GetServiceCredentialsRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves information of all service credentials for a service account.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetServiceCredentialsResponse> GetServiceCredentialsAsync(GetServiceCredentialsRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetServiceCredentialsRequestDescriptor, GetServiceCredentialsResponse, GetServiceCredentialsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves information of all service credentials for a service account.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetServiceCredentialsResponse> GetServiceCredentialsAsync(string ns, Elastic.Clients.Elasticsearch.Serverless.Name service, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetServiceCredentialsRequestDescriptor(ns, service);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetServiceCredentialsRequestDescriptor, GetServiceCredentialsResponse, GetServiceCredentialsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves information of all service credentials for a service account.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetServiceCredentialsResponse> GetServiceCredentialsAsync(string ns, Elastic.Clients.Elasticsearch.Serverless.Name service, Action<GetServiceCredentialsRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetServiceCredentialsRequestDescriptor(ns, service);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetServiceCredentialsRequestDescriptor, GetServiceCredentialsResponse, GetServiceCredentialsRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a bearer token for access without requiring basic authentication.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTokenResponse> GetTokenAsync(GetTokenRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetTokenRequest, GetTokenResponse, GetTokenRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a bearer token for access without requiring basic authentication.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTokenResponse> GetTokenAsync(GetTokenRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetTokenRequestDescriptor, GetTokenResponse, GetTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a bearer token for access without requiring basic authentication.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTokenResponse> GetTokenAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new GetTokenRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<GetTokenRequestDescriptor, GetTokenResponse, GetTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a bearer token for access without requiring basic authentication.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetTokenResponse> GetTokenAsync(Action<GetTokenRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetTokenRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetTokenRequestDescriptor, GetTokenResponse, GetTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves security privileges for the logged in user.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetUserPrivilegesResponse> GetUserPrivilegesAsync(GetUserPrivilegesRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetUserPrivilegesRequest, GetUserPrivilegesResponse, GetUserPrivilegesRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves security privileges for the logged in user.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetUserPrivilegesResponse> GetUserPrivilegesAsync(GetUserPrivilegesRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetUserPrivilegesRequestDescriptor, GetUserPrivilegesResponse, GetUserPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves security privileges for the logged in user.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetUserPrivilegesResponse> GetUserPrivilegesAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new GetUserPrivilegesRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<GetUserPrivilegesRequestDescriptor, GetUserPrivilegesResponse, GetUserPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves security privileges for the logged in user.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetUserPrivilegesResponse> GetUserPrivilegesAsync(Action<GetUserPrivilegesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetUserPrivilegesRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetUserPrivilegesRequestDescriptor, GetUserPrivilegesResponse, GetUserPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves a user's profile using the unique profile ID.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetUserProfileResponse> GetUserProfileAsync(GetUserProfileRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GetUserProfileRequest, GetUserProfileResponse, GetUserProfileRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves a user's profile using the unique profile ID.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetUserProfileResponse> GetUserProfileAsync(GetUserProfileRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GetUserProfileRequestDescriptor, GetUserProfileResponse, GetUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves a user's profile using the unique profile ID.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetUserProfileResponse> GetUserProfileAsync(IReadOnlyCollection<string> uid, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetUserProfileRequestDescriptor(uid);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetUserProfileRequestDescriptor, GetUserProfileResponse, GetUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves a user's profile using the unique profile ID.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GetUserProfileResponse> GetUserProfileAsync(IReadOnlyCollection<string> uid, Action<GetUserProfileRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GetUserProfileRequestDescriptor(uid);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GetUserProfileRequestDescriptor, GetUserProfileResponse, GetUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates an API key on behalf of another user.
	/// This API is similar to Create API keys, however it creates the API key for a user that is different than the user that runs the API.
	/// The caller must have authentication credentials (either an access token, or a username and password) for the user on whose behalf the API key will be created.
	/// It is not possible to use this API to create an API key without that user’s credentials.
	/// The user, for whom the authentication credentials is provided, can optionally "run as" (impersonate) another user.
	/// In this case, the API key will be created on behalf of the impersonated user.
	/// </para>
	/// <para>
	/// This API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf.
	/// </para>
	/// <para>
	/// A successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// </para>
	/// <para>
	/// By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GrantApiKeyResponse> GrantApiKeyAsync(GrantApiKeyRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<GrantApiKeyRequest, GrantApiKeyResponse, GrantApiKeyRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates an API key on behalf of another user.
	/// This API is similar to Create API keys, however it creates the API key for a user that is different than the user that runs the API.
	/// The caller must have authentication credentials (either an access token, or a username and password) for the user on whose behalf the API key will be created.
	/// It is not possible to use this API to create an API key without that user’s credentials.
	/// The user, for whom the authentication credentials is provided, can optionally "run as" (impersonate) another user.
	/// In this case, the API key will be created on behalf of the impersonated user.
	/// </para>
	/// <para>
	/// This API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf.
	/// </para>
	/// <para>
	/// A successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// </para>
	/// <para>
	/// By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GrantApiKeyResponse> GrantApiKeyAsync<TDocument>(GrantApiKeyRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GrantApiKeyRequestDescriptor<TDocument>, GrantApiKeyResponse, GrantApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates an API key on behalf of another user.
	/// This API is similar to Create API keys, however it creates the API key for a user that is different than the user that runs the API.
	/// The caller must have authentication credentials (either an access token, or a username and password) for the user on whose behalf the API key will be created.
	/// It is not possible to use this API to create an API key without that user’s credentials.
	/// The user, for whom the authentication credentials is provided, can optionally "run as" (impersonate) another user.
	/// In this case, the API key will be created on behalf of the impersonated user.
	/// </para>
	/// <para>
	/// This API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf.
	/// </para>
	/// <para>
	/// A successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// </para>
	/// <para>
	/// By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GrantApiKeyResponse> GrantApiKeyAsync<TDocument>(CancellationToken cancellationToken = default)
	{
		var descriptor = new GrantApiKeyRequestDescriptor<TDocument>();
		descriptor.BeforeRequest();
		return DoRequestAsync<GrantApiKeyRequestDescriptor<TDocument>, GrantApiKeyResponse, GrantApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates an API key on behalf of another user.
	/// This API is similar to Create API keys, however it creates the API key for a user that is different than the user that runs the API.
	/// The caller must have authentication credentials (either an access token, or a username and password) for the user on whose behalf the API key will be created.
	/// It is not possible to use this API to create an API key without that user’s credentials.
	/// The user, for whom the authentication credentials is provided, can optionally "run as" (impersonate) another user.
	/// In this case, the API key will be created on behalf of the impersonated user.
	/// </para>
	/// <para>
	/// This API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf.
	/// </para>
	/// <para>
	/// A successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// </para>
	/// <para>
	/// By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GrantApiKeyResponse> GrantApiKeyAsync<TDocument>(Action<GrantApiKeyRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GrantApiKeyRequestDescriptor<TDocument>();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GrantApiKeyRequestDescriptor<TDocument>, GrantApiKeyResponse, GrantApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates an API key on behalf of another user.
	/// This API is similar to Create API keys, however it creates the API key for a user that is different than the user that runs the API.
	/// The caller must have authentication credentials (either an access token, or a username and password) for the user on whose behalf the API key will be created.
	/// It is not possible to use this API to create an API key without that user’s credentials.
	/// The user, for whom the authentication credentials is provided, can optionally "run as" (impersonate) another user.
	/// In this case, the API key will be created on behalf of the impersonated user.
	/// </para>
	/// <para>
	/// This API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf.
	/// </para>
	/// <para>
	/// A successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// </para>
	/// <para>
	/// By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GrantApiKeyResponse> GrantApiKeyAsync(GrantApiKeyRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<GrantApiKeyRequestDescriptor, GrantApiKeyResponse, GrantApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates an API key on behalf of another user.
	/// This API is similar to Create API keys, however it creates the API key for a user that is different than the user that runs the API.
	/// The caller must have authentication credentials (either an access token, or a username and password) for the user on whose behalf the API key will be created.
	/// It is not possible to use this API to create an API key without that user’s credentials.
	/// The user, for whom the authentication credentials is provided, can optionally "run as" (impersonate) another user.
	/// In this case, the API key will be created on behalf of the impersonated user.
	/// </para>
	/// <para>
	/// This API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf.
	/// </para>
	/// <para>
	/// A successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// </para>
	/// <para>
	/// By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GrantApiKeyResponse> GrantApiKeyAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new GrantApiKeyRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<GrantApiKeyRequestDescriptor, GrantApiKeyResponse, GrantApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates an API key on behalf of another user.
	/// This API is similar to Create API keys, however it creates the API key for a user that is different than the user that runs the API.
	/// The caller must have authentication credentials (either an access token, or a username and password) for the user on whose behalf the API key will be created.
	/// It is not possible to use this API to create an API key without that user’s credentials.
	/// The user, for whom the authentication credentials is provided, can optionally "run as" (impersonate) another user.
	/// In this case, the API key will be created on behalf of the impersonated user.
	/// </para>
	/// <para>
	/// This API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf.
	/// </para>
	/// <para>
	/// A successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name.
	/// If applicable, it also returns expiration information for the API key in milliseconds.
	/// </para>
	/// <para>
	/// By default, API keys never expire. You can specify expiration information when you create the API keys.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<GrantApiKeyResponse> GrantApiKeyAsync(Action<GrantApiKeyRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new GrantApiKeyRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<GrantApiKeyRequestDescriptor, GrantApiKeyResponse, GrantApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Check user privileges.
	/// Determines whether the specified user has a specified list of privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<HasPrivilegesResponse> HasPrivilegesAsync(HasPrivilegesRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<HasPrivilegesRequest, HasPrivilegesResponse, HasPrivilegesRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Check user privileges.
	/// Determines whether the specified user has a specified list of privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<HasPrivilegesResponse> HasPrivilegesAsync(HasPrivilegesRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<HasPrivilegesRequestDescriptor, HasPrivilegesResponse, HasPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Check user privileges.
	/// Determines whether the specified user has a specified list of privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<HasPrivilegesResponse> HasPrivilegesAsync(Elastic.Clients.Elasticsearch.Serverless.Name? user, CancellationToken cancellationToken = default)
	{
		var descriptor = new HasPrivilegesRequestDescriptor(user);
		descriptor.BeforeRequest();
		return DoRequestAsync<HasPrivilegesRequestDescriptor, HasPrivilegesResponse, HasPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Check user privileges.
	/// Determines whether the specified user has a specified list of privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<HasPrivilegesResponse> HasPrivilegesAsync(Elastic.Clients.Elasticsearch.Serverless.Name? user, Action<HasPrivilegesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new HasPrivilegesRequestDescriptor(user);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<HasPrivilegesRequestDescriptor, HasPrivilegesResponse, HasPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Check user privileges.
	/// Determines whether the specified user has a specified list of privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<HasPrivilegesResponse> HasPrivilegesAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new HasPrivilegesRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<HasPrivilegesRequestDescriptor, HasPrivilegesResponse, HasPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Check user privileges.
	/// Determines whether the specified user has a specified list of privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<HasPrivilegesResponse> HasPrivilegesAsync(Action<HasPrivilegesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new HasPrivilegesRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<HasPrivilegesRequestDescriptor, HasPrivilegesResponse, HasPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Determines whether the users associated with the specified profile IDs have all the requested privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<HasPrivilegesUserProfileResponse> HasPrivilegesUserProfileAsync(HasPrivilegesUserProfileRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<HasPrivilegesUserProfileRequest, HasPrivilegesUserProfileResponse, HasPrivilegesUserProfileRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Determines whether the users associated with the specified profile IDs have all the requested privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<HasPrivilegesUserProfileResponse> HasPrivilegesUserProfileAsync(HasPrivilegesUserProfileRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<HasPrivilegesUserProfileRequestDescriptor, HasPrivilegesUserProfileResponse, HasPrivilegesUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Determines whether the users associated with the specified profile IDs have all the requested privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<HasPrivilegesUserProfileResponse> HasPrivilegesUserProfileAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new HasPrivilegesUserProfileRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<HasPrivilegesUserProfileRequestDescriptor, HasPrivilegesUserProfileResponse, HasPrivilegesUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Determines whether the users associated with the specified profile IDs have all the requested privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<HasPrivilegesUserProfileResponse> HasPrivilegesUserProfileAsync(Action<HasPrivilegesUserProfileRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new HasPrivilegesUserProfileRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<HasPrivilegesUserProfileRequestDescriptor, HasPrivilegesUserProfileResponse, HasPrivilegesUserProfileRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Invalidate API keys.
	/// Invalidates one or more API keys.
	/// The <c>manage_api_key</c> privilege allows deleting any API keys.
	/// The <c>manage_own_api_key</c> only allows deleting API keys that are owned by the user.
	/// In addition, with the <c>manage_own_api_key</c> privilege, an invalidation request must be issued in one of the three formats:
	/// </para>
	/// <list type="bullet">
	/// <item>
	/// <para>
	/// Set the parameter <c>owner=true</c>.
	/// </para>
	/// </item>
	/// <item>
	/// <para>
	/// Or, set both <c>username</c> and <c>realm_name</c> to match the user’s identity.
	/// </para>
	/// </item>
	/// <item>
	/// <para>
	/// Or, if the request is issued by an API key, i.e. an API key invalidates itself, specify its ID in the <c>ids</c> field.
	/// </para>
	/// </item>
	/// </list>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<InvalidateApiKeyResponse> InvalidateApiKeyAsync(InvalidateApiKeyRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<InvalidateApiKeyRequest, InvalidateApiKeyResponse, InvalidateApiKeyRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Invalidate API keys.
	/// Invalidates one or more API keys.
	/// The <c>manage_api_key</c> privilege allows deleting any API keys.
	/// The <c>manage_own_api_key</c> only allows deleting API keys that are owned by the user.
	/// In addition, with the <c>manage_own_api_key</c> privilege, an invalidation request must be issued in one of the three formats:
	/// </para>
	/// <list type="bullet">
	/// <item>
	/// <para>
	/// Set the parameter <c>owner=true</c>.
	/// </para>
	/// </item>
	/// <item>
	/// <para>
	/// Or, set both <c>username</c> and <c>realm_name</c> to match the user’s identity.
	/// </para>
	/// </item>
	/// <item>
	/// <para>
	/// Or, if the request is issued by an API key, i.e. an API key invalidates itself, specify its ID in the <c>ids</c> field.
	/// </para>
	/// </item>
	/// </list>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<InvalidateApiKeyResponse> InvalidateApiKeyAsync(InvalidateApiKeyRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<InvalidateApiKeyRequestDescriptor, InvalidateApiKeyResponse, InvalidateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Invalidate API keys.
	/// Invalidates one or more API keys.
	/// The <c>manage_api_key</c> privilege allows deleting any API keys.
	/// The <c>manage_own_api_key</c> only allows deleting API keys that are owned by the user.
	/// In addition, with the <c>manage_own_api_key</c> privilege, an invalidation request must be issued in one of the three formats:
	/// </para>
	/// <list type="bullet">
	/// <item>
	/// <para>
	/// Set the parameter <c>owner=true</c>.
	/// </para>
	/// </item>
	/// <item>
	/// <para>
	/// Or, set both <c>username</c> and <c>realm_name</c> to match the user’s identity.
	/// </para>
	/// </item>
	/// <item>
	/// <para>
	/// Or, if the request is issued by an API key, i.e. an API key invalidates itself, specify its ID in the <c>ids</c> field.
	/// </para>
	/// </item>
	/// </list>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<InvalidateApiKeyResponse> InvalidateApiKeyAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new InvalidateApiKeyRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<InvalidateApiKeyRequestDescriptor, InvalidateApiKeyResponse, InvalidateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Invalidate API keys.
	/// Invalidates one or more API keys.
	/// The <c>manage_api_key</c> privilege allows deleting any API keys.
	/// The <c>manage_own_api_key</c> only allows deleting API keys that are owned by the user.
	/// In addition, with the <c>manage_own_api_key</c> privilege, an invalidation request must be issued in one of the three formats:
	/// </para>
	/// <list type="bullet">
	/// <item>
	/// <para>
	/// Set the parameter <c>owner=true</c>.
	/// </para>
	/// </item>
	/// <item>
	/// <para>
	/// Or, set both <c>username</c> and <c>realm_name</c> to match the user’s identity.
	/// </para>
	/// </item>
	/// <item>
	/// <para>
	/// Or, if the request is issued by an API key, i.e. an API key invalidates itself, specify its ID in the <c>ids</c> field.
	/// </para>
	/// </item>
	/// </list>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<InvalidateApiKeyResponse> InvalidateApiKeyAsync(Action<InvalidateApiKeyRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new InvalidateApiKeyRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<InvalidateApiKeyRequestDescriptor, InvalidateApiKeyResponse, InvalidateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Invalidates one or more access tokens or refresh tokens.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<InvalidateTokenResponse> InvalidateTokenAsync(InvalidateTokenRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<InvalidateTokenRequest, InvalidateTokenResponse, InvalidateTokenRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Invalidates one or more access tokens or refresh tokens.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<InvalidateTokenResponse> InvalidateTokenAsync(InvalidateTokenRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<InvalidateTokenRequestDescriptor, InvalidateTokenResponse, InvalidateTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Invalidates one or more access tokens or refresh tokens.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<InvalidateTokenResponse> InvalidateTokenAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new InvalidateTokenRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<InvalidateTokenRequestDescriptor, InvalidateTokenResponse, InvalidateTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Invalidates one or more access tokens or refresh tokens.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<InvalidateTokenResponse> InvalidateTokenAsync(Action<InvalidateTokenRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new InvalidateTokenRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<InvalidateTokenRequestDescriptor, InvalidateTokenResponse, InvalidateTokenRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Adds or updates application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutPrivilegesResponse> PutPrivilegesAsync(PutPrivilegesRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<PutPrivilegesRequest, PutPrivilegesResponse, PutPrivilegesRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Adds or updates application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutPrivilegesResponse> PutPrivilegesAsync(PutPrivilegesRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<PutPrivilegesRequestDescriptor, PutPrivilegesResponse, PutPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Adds or updates application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutPrivilegesResponse> PutPrivilegesAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new PutPrivilegesRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<PutPrivilegesRequestDescriptor, PutPrivilegesResponse, PutPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Adds or updates application privileges.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutPrivilegesResponse> PutPrivilegesAsync(Action<PutPrivilegesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutPrivilegesRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutPrivilegesRequestDescriptor, PutPrivilegesResponse, PutPrivilegesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRoleResponse> PutRoleAsync(PutRoleRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<PutRoleRequest, PutRoleResponse, PutRoleRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRoleResponse> PutRoleAsync<TDocument>(PutRoleRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRoleRequestDescriptor<TDocument>, PutRoleResponse, PutRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRoleResponse> PutRoleAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutRoleRequestDescriptor<TDocument>(name);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRoleRequestDescriptor<TDocument>, PutRoleResponse, PutRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRoleResponse> PutRoleAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Name name, Action<PutRoleRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutRoleRequestDescriptor<TDocument>(name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRoleRequestDescriptor<TDocument>, PutRoleResponse, PutRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRoleResponse> PutRoleAsync(PutRoleRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRoleRequestDescriptor, PutRoleResponse, PutRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRoleResponse> PutRoleAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutRoleRequestDescriptor(name);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRoleRequestDescriptor, PutRoleResponse, PutRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// The role management APIs are generally the preferred way to manage roles, rather than using file-based role management.
	/// The create or update roles API cannot update roles that are defined in roles files.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRoleResponse> PutRoleAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action<PutRoleRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutRoleRequestDescriptor(name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRoleRequestDescriptor, PutRoleResponse, PutRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates and updates role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRoleMappingResponse> PutRoleMappingAsync(PutRoleMappingRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<PutRoleMappingRequest, PutRoleMappingResponse, PutRoleMappingRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates and updates role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRoleMappingResponse> PutRoleMappingAsync(PutRoleMappingRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRoleMappingRequestDescriptor, PutRoleMappingResponse, PutRoleMappingRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates and updates role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRoleMappingResponse> PutRoleMappingAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutRoleMappingRequestDescriptor(name);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRoleMappingRequestDescriptor, PutRoleMappingResponse, PutRoleMappingRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates and updates role mappings.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<PutRoleMappingResponse> PutRoleMappingAsync(Elastic.Clients.Elasticsearch.Serverless.Name name, Action<PutRoleMappingRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new PutRoleMappingRequestDescriptor(name);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<PutRoleMappingRequestDescriptor, PutRoleMappingResponse, PutRoleMappingRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Query API keys.
	/// Retrieves a paginated list of API keys and their information. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryApiKeysResponse> QueryApiKeysAsync(QueryApiKeysRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<QueryApiKeysRequest, QueryApiKeysResponse, QueryApiKeysRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Query API keys.
	/// Retrieves a paginated list of API keys and their information. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryApiKeysResponse> QueryApiKeysAsync<TDocument>(QueryApiKeysRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryApiKeysRequestDescriptor<TDocument>, QueryApiKeysResponse, QueryApiKeysRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Query API keys.
	/// Retrieves a paginated list of API keys and their information. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryApiKeysResponse> QueryApiKeysAsync<TDocument>(CancellationToken cancellationToken = default)
	{
		var descriptor = new QueryApiKeysRequestDescriptor<TDocument>();
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryApiKeysRequestDescriptor<TDocument>, QueryApiKeysResponse, QueryApiKeysRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Query API keys.
	/// Retrieves a paginated list of API keys and their information. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryApiKeysResponse> QueryApiKeysAsync<TDocument>(Action<QueryApiKeysRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new QueryApiKeysRequestDescriptor<TDocument>();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryApiKeysRequestDescriptor<TDocument>, QueryApiKeysResponse, QueryApiKeysRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Query API keys.
	/// Retrieves a paginated list of API keys and their information. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryApiKeysResponse> QueryApiKeysAsync(QueryApiKeysRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryApiKeysRequestDescriptor, QueryApiKeysResponse, QueryApiKeysRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Query API keys.
	/// Retrieves a paginated list of API keys and their information. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryApiKeysResponse> QueryApiKeysAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new QueryApiKeysRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryApiKeysRequestDescriptor, QueryApiKeysResponse, QueryApiKeysRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Query API keys.
	/// Retrieves a paginated list of API keys and their information. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryApiKeysResponse> QueryApiKeysAsync(Action<QueryApiKeysRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new QueryApiKeysRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryApiKeysRequestDescriptor, QueryApiKeysResponse, QueryApiKeysRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves roles in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryRoleResponse> QueryRoleAsync(QueryRoleRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<QueryRoleRequest, QueryRoleResponse, QueryRoleRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves roles in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryRoleResponse> QueryRoleAsync<TDocument>(QueryRoleRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryRoleRequestDescriptor<TDocument>, QueryRoleResponse, QueryRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves roles in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryRoleResponse> QueryRoleAsync<TDocument>(CancellationToken cancellationToken = default)
	{
		var descriptor = new QueryRoleRequestDescriptor<TDocument>();
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryRoleRequestDescriptor<TDocument>, QueryRoleResponse, QueryRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves roles in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryRoleResponse> QueryRoleAsync<TDocument>(Action<QueryRoleRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new QueryRoleRequestDescriptor<TDocument>();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryRoleRequestDescriptor<TDocument>, QueryRoleResponse, QueryRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves roles in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryRoleResponse> QueryRoleAsync(QueryRoleRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryRoleRequestDescriptor, QueryRoleResponse, QueryRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves roles in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryRoleResponse> QueryRoleAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new QueryRoleRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryRoleRequestDescriptor, QueryRoleResponse, QueryRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves roles in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryRoleResponse> QueryRoleAsync(Action<QueryRoleRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new QueryRoleRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryRoleRequestDescriptor, QueryRoleResponse, QueryRoleRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves information for Users in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryUserResponse> QueryUserAsync(QueryUserRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<QueryUserRequest, QueryUserResponse, QueryUserRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves information for Users in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryUserResponse> QueryUserAsync<TDocument>(QueryUserRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryUserRequestDescriptor<TDocument>, QueryUserResponse, QueryUserRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves information for Users in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryUserResponse> QueryUserAsync<TDocument>(CancellationToken cancellationToken = default)
	{
		var descriptor = new QueryUserRequestDescriptor<TDocument>();
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryUserRequestDescriptor<TDocument>, QueryUserResponse, QueryUserRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves information for Users in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryUserResponse> QueryUserAsync<TDocument>(Action<QueryUserRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new QueryUserRequestDescriptor<TDocument>();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryUserRequestDescriptor<TDocument>, QueryUserResponse, QueryUserRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves information for Users in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryUserResponse> QueryUserAsync(QueryUserRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryUserRequestDescriptor, QueryUserResponse, QueryUserRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves information for Users in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryUserResponse> QueryUserAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new QueryUserRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryUserRequestDescriptor, QueryUserResponse, QueryUserRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Retrieves information for Users in a paginated manner. You can optionally filter the results with a query.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<QueryUserResponse> QueryUserAsync(Action<QueryUserRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new QueryUserRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<QueryUserRequestDescriptor, QueryUserResponse, QueryUserRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Submits a SAML Response message to Elasticsearch for consumption.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlAuthenticateResponse> SamlAuthenticateAsync(SamlAuthenticateRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<SamlAuthenticateRequest, SamlAuthenticateResponse, SamlAuthenticateRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Submits a SAML Response message to Elasticsearch for consumption.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlAuthenticateResponse> SamlAuthenticateAsync(SamlAuthenticateRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlAuthenticateRequestDescriptor, SamlAuthenticateResponse, SamlAuthenticateRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Submits a SAML Response message to Elasticsearch for consumption.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlAuthenticateResponse> SamlAuthenticateAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new SamlAuthenticateRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlAuthenticateRequestDescriptor, SamlAuthenticateResponse, SamlAuthenticateRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Submits a SAML Response message to Elasticsearch for consumption.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlAuthenticateResponse> SamlAuthenticateAsync(Action<SamlAuthenticateRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new SamlAuthenticateRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlAuthenticateRequestDescriptor, SamlAuthenticateResponse, SamlAuthenticateRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Verifies the logout response sent from the SAML IdP.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlCompleteLogoutResponse> SamlCompleteLogoutAsync(SamlCompleteLogoutRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<SamlCompleteLogoutRequest, SamlCompleteLogoutResponse, SamlCompleteLogoutRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Verifies the logout response sent from the SAML IdP.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlCompleteLogoutResponse> SamlCompleteLogoutAsync(SamlCompleteLogoutRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlCompleteLogoutRequestDescriptor, SamlCompleteLogoutResponse, SamlCompleteLogoutRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Verifies the logout response sent from the SAML IdP.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlCompleteLogoutResponse> SamlCompleteLogoutAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new SamlCompleteLogoutRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlCompleteLogoutRequestDescriptor, SamlCompleteLogoutResponse, SamlCompleteLogoutRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Verifies the logout response sent from the SAML IdP.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlCompleteLogoutResponse> SamlCompleteLogoutAsync(Action<SamlCompleteLogoutRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new SamlCompleteLogoutRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlCompleteLogoutRequestDescriptor, SamlCompleteLogoutResponse, SamlCompleteLogoutRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Submits a SAML LogoutRequest message to Elasticsearch for consumption.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlInvalidateResponse> SamlInvalidateAsync(SamlInvalidateRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<SamlInvalidateRequest, SamlInvalidateResponse, SamlInvalidateRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Submits a SAML LogoutRequest message to Elasticsearch for consumption.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlInvalidateResponse> SamlInvalidateAsync(SamlInvalidateRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlInvalidateRequestDescriptor, SamlInvalidateResponse, SamlInvalidateRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Submits a SAML LogoutRequest message to Elasticsearch for consumption.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlInvalidateResponse> SamlInvalidateAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new SamlInvalidateRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlInvalidateRequestDescriptor, SamlInvalidateResponse, SamlInvalidateRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Submits a SAML LogoutRequest message to Elasticsearch for consumption.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlInvalidateResponse> SamlInvalidateAsync(Action<SamlInvalidateRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new SamlInvalidateRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlInvalidateRequestDescriptor, SamlInvalidateResponse, SamlInvalidateRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Submits a request to invalidate an access token and refresh token.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlLogoutResponse> SamlLogoutAsync(SamlLogoutRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<SamlLogoutRequest, SamlLogoutResponse, SamlLogoutRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Submits a request to invalidate an access token and refresh token.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlLogoutResponse> SamlLogoutAsync(SamlLogoutRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlLogoutRequestDescriptor, SamlLogoutResponse, SamlLogoutRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Submits a request to invalidate an access token and refresh token.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlLogoutResponse> SamlLogoutAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new SamlLogoutRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlLogoutRequestDescriptor, SamlLogoutResponse, SamlLogoutRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Submits a request to invalidate an access token and refresh token.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlLogoutResponse> SamlLogoutAsync(Action<SamlLogoutRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new SamlLogoutRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlLogoutRequestDescriptor, SamlLogoutResponse, SamlLogoutRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a SAML authentication request (&lt;AuthnRequest>) as a URL string, based on the configuration of the respective SAML realm in Elasticsearch.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlPrepareAuthenticationResponse> SamlPrepareAuthenticationAsync(SamlPrepareAuthenticationRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<SamlPrepareAuthenticationRequest, SamlPrepareAuthenticationResponse, SamlPrepareAuthenticationRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a SAML authentication request (&lt;AuthnRequest>) as a URL string, based on the configuration of the respective SAML realm in Elasticsearch.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlPrepareAuthenticationResponse> SamlPrepareAuthenticationAsync(SamlPrepareAuthenticationRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlPrepareAuthenticationRequestDescriptor, SamlPrepareAuthenticationResponse, SamlPrepareAuthenticationRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a SAML authentication request (&lt;AuthnRequest>) as a URL string, based on the configuration of the respective SAML realm in Elasticsearch.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlPrepareAuthenticationResponse> SamlPrepareAuthenticationAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new SamlPrepareAuthenticationRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlPrepareAuthenticationRequestDescriptor, SamlPrepareAuthenticationResponse, SamlPrepareAuthenticationRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Creates a SAML authentication request (&lt;AuthnRequest>) as a URL string, based on the configuration of the respective SAML realm in Elasticsearch.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlPrepareAuthenticationResponse> SamlPrepareAuthenticationAsync(Action<SamlPrepareAuthenticationRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new SamlPrepareAuthenticationRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlPrepareAuthenticationRequestDescriptor, SamlPrepareAuthenticationResponse, SamlPrepareAuthenticationRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Generate SAML metadata for a SAML 2.0 Service Provider.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlServiceProviderMetadataResponse> SamlServiceProviderMetadataAsync(SamlServiceProviderMetadataRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<SamlServiceProviderMetadataRequest, SamlServiceProviderMetadataResponse, SamlServiceProviderMetadataRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Generate SAML metadata for a SAML 2.0 Service Provider.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlServiceProviderMetadataResponse> SamlServiceProviderMetadataAsync(SamlServiceProviderMetadataRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlServiceProviderMetadataRequestDescriptor, SamlServiceProviderMetadataResponse, SamlServiceProviderMetadataRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Generate SAML metadata for a SAML 2.0 Service Provider.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlServiceProviderMetadataResponse> SamlServiceProviderMetadataAsync(Elastic.Clients.Elasticsearch.Serverless.Name realmName, CancellationToken cancellationToken = default)
	{
		var descriptor = new SamlServiceProviderMetadataRequestDescriptor(realmName);
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlServiceProviderMetadataRequestDescriptor, SamlServiceProviderMetadataResponse, SamlServiceProviderMetadataRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Generate SAML metadata for a SAML 2.0 Service Provider.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SamlServiceProviderMetadataResponse> SamlServiceProviderMetadataAsync(Elastic.Clients.Elasticsearch.Serverless.Name realmName, Action<SamlServiceProviderMetadataRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new SamlServiceProviderMetadataRequestDescriptor(realmName);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<SamlServiceProviderMetadataRequestDescriptor, SamlServiceProviderMetadataResponse, SamlServiceProviderMetadataRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get suggestions for user profiles that match specified search criteria.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SuggestUserProfilesResponse> SuggestUserProfilesAsync(SuggestUserProfilesRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<SuggestUserProfilesRequest, SuggestUserProfilesResponse, SuggestUserProfilesRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get suggestions for user profiles that match specified search criteria.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SuggestUserProfilesResponse> SuggestUserProfilesAsync(SuggestUserProfilesRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<SuggestUserProfilesRequestDescriptor, SuggestUserProfilesResponse, SuggestUserProfilesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get suggestions for user profiles that match specified search criteria.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SuggestUserProfilesResponse> SuggestUserProfilesAsync(CancellationToken cancellationToken = default)
	{
		var descriptor = new SuggestUserProfilesRequestDescriptor();
		descriptor.BeforeRequest();
		return DoRequestAsync<SuggestUserProfilesRequestDescriptor, SuggestUserProfilesResponse, SuggestUserProfilesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Get suggestions for user profiles that match specified search criteria.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/master/security-api-suggest-user-profile.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<SuggestUserProfilesResponse> SuggestUserProfilesAsync(Action<SuggestUserProfilesRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new SuggestUserProfilesRequestDescriptor();
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<SuggestUserProfilesRequestDescriptor, SuggestUserProfilesResponse, SuggestUserProfilesRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update an API key.
	/// Updates attributes of an existing API key.
	/// Users can only update API keys that they created or that were granted to them.
	/// Use this API to update API keys created by the create API Key or grant API Key APIs.
	/// If you need to apply the same update to many API keys, you can use bulk update API Keys to reduce overhead.
	/// It’s not possible to update expired API keys, or API keys that have been invalidated by invalidate API Key.
	/// This API supports updates to an API key’s access scope and metadata.
	/// The access scope of an API key is derived from the <c>role_descriptors</c> you specify in the request, and a snapshot of the owner user’s permissions at the time of the request.
	/// The snapshot of the owner’s permissions is updated automatically on every call.
	/// If you don’t specify <c>role_descriptors</c> in the request, a call to this API might still change the API key’s access scope.
	/// This change can occur if the owner user’s permissions have changed since the API key was created or last modified.
	/// To update another user’s API key, use the <c>run_as</c> feature to submit a request on behalf of another user.
	/// IMPORTANT: It’s not possible to use an API key as the authentication credential for this API.
	/// To update an API key, the owner user’s credentials are required.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateApiKeyResponse> UpdateApiKeyAsync(UpdateApiKeyRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<UpdateApiKeyRequest, UpdateApiKeyResponse, UpdateApiKeyRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update an API key.
	/// Updates attributes of an existing API key.
	/// Users can only update API keys that they created or that were granted to them.
	/// Use this API to update API keys created by the create API Key or grant API Key APIs.
	/// If you need to apply the same update to many API keys, you can use bulk update API Keys to reduce overhead.
	/// It’s not possible to update expired API keys, or API keys that have been invalidated by invalidate API Key.
	/// This API supports updates to an API key’s access scope and metadata.
	/// The access scope of an API key is derived from the <c>role_descriptors</c> you specify in the request, and a snapshot of the owner user’s permissions at the time of the request.
	/// The snapshot of the owner’s permissions is updated automatically on every call.
	/// If you don’t specify <c>role_descriptors</c> in the request, a call to this API might still change the API key’s access scope.
	/// This change can occur if the owner user’s permissions have changed since the API key was created or last modified.
	/// To update another user’s API key, use the <c>run_as</c> feature to submit a request on behalf of another user.
	/// IMPORTANT: It’s not possible to use an API key as the authentication credential for this API.
	/// To update an API key, the owner user’s credentials are required.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateApiKeyResponse> UpdateApiKeyAsync<TDocument>(UpdateApiKeyRequestDescriptor<TDocument> descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateApiKeyRequestDescriptor<TDocument>, UpdateApiKeyResponse, UpdateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update an API key.
	/// Updates attributes of an existing API key.
	/// Users can only update API keys that they created or that were granted to them.
	/// Use this API to update API keys created by the create API Key or grant API Key APIs.
	/// If you need to apply the same update to many API keys, you can use bulk update API Keys to reduce overhead.
	/// It’s not possible to update expired API keys, or API keys that have been invalidated by invalidate API Key.
	/// This API supports updates to an API key’s access scope and metadata.
	/// The access scope of an API key is derived from the <c>role_descriptors</c> you specify in the request, and a snapshot of the owner user’s permissions at the time of the request.
	/// The snapshot of the owner’s permissions is updated automatically on every call.
	/// If you don’t specify <c>role_descriptors</c> in the request, a call to this API might still change the API key’s access scope.
	/// This change can occur if the owner user’s permissions have changed since the API key was created or last modified.
	/// To update another user’s API key, use the <c>run_as</c> feature to submit a request on behalf of another user.
	/// IMPORTANT: It’s not possible to use an API key as the authentication credential for this API.
	/// To update an API key, the owner user’s credentials are required.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateApiKeyResponse> UpdateApiKeyAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default)
	{
		var descriptor = new UpdateApiKeyRequestDescriptor<TDocument>(id);
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateApiKeyRequestDescriptor<TDocument>, UpdateApiKeyResponse, UpdateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update an API key.
	/// Updates attributes of an existing API key.
	/// Users can only update API keys that they created or that were granted to them.
	/// Use this API to update API keys created by the create API Key or grant API Key APIs.
	/// If you need to apply the same update to many API keys, you can use bulk update API Keys to reduce overhead.
	/// It’s not possible to update expired API keys, or API keys that have been invalidated by invalidate API Key.
	/// This API supports updates to an API key’s access scope and metadata.
	/// The access scope of an API key is derived from the <c>role_descriptors</c> you specify in the request, and a snapshot of the owner user’s permissions at the time of the request.
	/// The snapshot of the owner’s permissions is updated automatically on every call.
	/// If you don’t specify <c>role_descriptors</c> in the request, a call to this API might still change the API key’s access scope.
	/// This change can occur if the owner user’s permissions have changed since the API key was created or last modified.
	/// To update another user’s API key, use the <c>run_as</c> feature to submit a request on behalf of another user.
	/// IMPORTANT: It’s not possible to use an API key as the authentication credential for this API.
	/// To update an API key, the owner user’s credentials are required.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateApiKeyResponse> UpdateApiKeyAsync<TDocument>(Elastic.Clients.Elasticsearch.Serverless.Id id, Action<UpdateApiKeyRequestDescriptor<TDocument>> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new UpdateApiKeyRequestDescriptor<TDocument>(id);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateApiKeyRequestDescriptor<TDocument>, UpdateApiKeyResponse, UpdateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update an API key.
	/// Updates attributes of an existing API key.
	/// Users can only update API keys that they created or that were granted to them.
	/// Use this API to update API keys created by the create API Key or grant API Key APIs.
	/// If you need to apply the same update to many API keys, you can use bulk update API Keys to reduce overhead.
	/// It’s not possible to update expired API keys, or API keys that have been invalidated by invalidate API Key.
	/// This API supports updates to an API key’s access scope and metadata.
	/// The access scope of an API key is derived from the <c>role_descriptors</c> you specify in the request, and a snapshot of the owner user’s permissions at the time of the request.
	/// The snapshot of the owner’s permissions is updated automatically on every call.
	/// If you don’t specify <c>role_descriptors</c> in the request, a call to this API might still change the API key’s access scope.
	/// This change can occur if the owner user’s permissions have changed since the API key was created or last modified.
	/// To update another user’s API key, use the <c>run_as</c> feature to submit a request on behalf of another user.
	/// IMPORTANT: It’s not possible to use an API key as the authentication credential for this API.
	/// To update an API key, the owner user’s credentials are required.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateApiKeyResponse> UpdateApiKeyAsync(UpdateApiKeyRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateApiKeyRequestDescriptor, UpdateApiKeyResponse, UpdateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update an API key.
	/// Updates attributes of an existing API key.
	/// Users can only update API keys that they created or that were granted to them.
	/// Use this API to update API keys created by the create API Key or grant API Key APIs.
	/// If you need to apply the same update to many API keys, you can use bulk update API Keys to reduce overhead.
	/// It’s not possible to update expired API keys, or API keys that have been invalidated by invalidate API Key.
	/// This API supports updates to an API key’s access scope and metadata.
	/// The access scope of an API key is derived from the <c>role_descriptors</c> you specify in the request, and a snapshot of the owner user’s permissions at the time of the request.
	/// The snapshot of the owner’s permissions is updated automatically on every call.
	/// If you don’t specify <c>role_descriptors</c> in the request, a call to this API might still change the API key’s access scope.
	/// This change can occur if the owner user’s permissions have changed since the API key was created or last modified.
	/// To update another user’s API key, use the <c>run_as</c> feature to submit a request on behalf of another user.
	/// IMPORTANT: It’s not possible to use an API key as the authentication credential for this API.
	/// To update an API key, the owner user’s credentials are required.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateApiKeyResponse> UpdateApiKeyAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, CancellationToken cancellationToken = default)
	{
		var descriptor = new UpdateApiKeyRequestDescriptor(id);
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateApiKeyRequestDescriptor, UpdateApiKeyResponse, UpdateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Update an API key.
	/// Updates attributes of an existing API key.
	/// Users can only update API keys that they created or that were granted to them.
	/// Use this API to update API keys created by the create API Key or grant API Key APIs.
	/// If you need to apply the same update to many API keys, you can use bulk update API Keys to reduce overhead.
	/// It’s not possible to update expired API keys, or API keys that have been invalidated by invalidate API Key.
	/// This API supports updates to an API key’s access scope and metadata.
	/// The access scope of an API key is derived from the <c>role_descriptors</c> you specify in the request, and a snapshot of the owner user’s permissions at the time of the request.
	/// The snapshot of the owner’s permissions is updated automatically on every call.
	/// If you don’t specify <c>role_descriptors</c> in the request, a call to this API might still change the API key’s access scope.
	/// This change can occur if the owner user’s permissions have changed since the API key was created or last modified.
	/// To update another user’s API key, use the <c>run_as</c> feature to submit a request on behalf of another user.
	/// IMPORTANT: It’s not possible to use an API key as the authentication credential for this API.
	/// To update an API key, the owner user’s credentials are required.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateApiKeyResponse> UpdateApiKeyAsync(Elastic.Clients.Elasticsearch.Serverless.Id id, Action<UpdateApiKeyRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new UpdateApiKeyRequestDescriptor(id);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateApiKeyRequestDescriptor, UpdateApiKeyResponse, UpdateApiKeyRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Updates specific data for the user profile that's associated with the specified unique ID.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateUserProfileDataResponse> UpdateUserProfileDataAsync(UpdateUserProfileDataRequest request, CancellationToken cancellationToken = default)
	{
		request.BeforeRequest();
		return DoRequestAsync<UpdateUserProfileDataRequest, UpdateUserProfileDataResponse, UpdateUserProfileDataRequestParameters>(request, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Updates specific data for the user profile that's associated with the specified unique ID.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateUserProfileDataResponse> UpdateUserProfileDataAsync(UpdateUserProfileDataRequestDescriptor descriptor, CancellationToken cancellationToken = default)
	{
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateUserProfileDataRequestDescriptor, UpdateUserProfileDataResponse, UpdateUserProfileDataRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Updates specific data for the user profile that's associated with the specified unique ID.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateUserProfileDataResponse> UpdateUserProfileDataAsync(string uid, CancellationToken cancellationToken = default)
	{
		var descriptor = new UpdateUserProfileDataRequestDescriptor(uid);
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateUserProfileDataRequestDescriptor, UpdateUserProfileDataResponse, UpdateUserProfileDataRequestParameters>(descriptor, cancellationToken);
	}

	/// <summary>
	/// <para>
	/// Updates specific data for the user profile that's associated with the specified unique ID.
	/// </para>
	/// <para><see href="https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-user-profile-data.html">Learn more about this API in the Elasticsearch documentation.</see></para>
	/// </summary>
	public virtual Task<UpdateUserProfileDataResponse> UpdateUserProfileDataAsync(string uid, Action<UpdateUserProfileDataRequestDescriptor> configureRequest, CancellationToken cancellationToken = default)
	{
		var descriptor = new UpdateUserProfileDataRequestDescriptor(uid);
		configureRequest?.Invoke(descriptor);
		descriptor.BeforeRequest();
		return DoRequestAsync<UpdateUserProfileDataRequestDescriptor, UpdateUserProfileDataResponse, UpdateUserProfileDataRequestParameters>(descriptor, cancellationToken);
	}
}